package indi.h.security.util;

import java.util.Random;

public class RandomData {
	private static String str = "0123456789abcdefghijklmnopqrstuvwxyz";
	private static char[] chars;
	static {
		chars = str.toCharArray();
	}

	public static String randomStr(int length) {
		Random r = new Random();
		String a = "";
		int i = 0;
		while (i < length) {
			a += chars[r.nextInt(36)];
			i++;
		}
		return a;
	}
	public static byte[] randomByte(int length){
		byte[] b=new byte[length];
		Random r=new Random();
		r.nextBytes(b);
		return b;
	}

	public static void main(String[] args) {
		System.out.println(randomStr(10));
	}

}
